package com.example.utils;

import java.io.File;

/**
 * @author swain
 * @description:
 * @date 2020/12/3
 */
public class FileUtils {

    /**
     * @Description 创建文件
     * @Param filePath
     * @return java.io.File
     * @Author swain
     * @Date  2020/12/3
     */
    public static File createFile(String filePath) throws Exception {
        File file = new File(filePath);
        if (!file.exists()) {
            File dir = new File(file.getParent());
            dir.mkdirs();
            file.createNewFile();
        }
        return file;
    }

}
